package com.hylanda.va.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hylanda.va.entity.SysOrders;
import com.hylanda.va.model.OrderQuery;
import com.hylanda.va.service.OrderService;
/** 
 * @author zhangy
 * @E-mail:blackoon88@gmail.com 
 * @qq:846579287
 * @version created at：2018年5月17日 上午10:35:47 
 * note
 */
@Controller
@RequestMapping("/order")
public class OrderController {
	private static final String prefix = "va/order/";
	@Autowired
	public OrderService orderService;
	@RequestMapping(value = { "/index" }, method = RequestMethod.GET)
	public String insert(HttpServletRequest request,
			HttpServletResponse response){
		return prefix+"index";
	}
	@RequestMapping(value = "/list")
	@ResponseBody
	public Page<SysOrders> getList(OrderQuery orderQuery) {
		Page<SysOrders> page=orderService.findOrderCriteria(orderQuery.getPage(), orderQuery.getSize(), orderQuery);
		return page;
	}
	
}
